﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MaxLeaf.DB;
using MaxLeaf.Common;
using System.Data.SqlClient;
using System.Data;

namespace MaxLeaf.DAL.K2K
{
    
    //上级组
    public class ImInvGroup_1DAL : BaseGroupDAL
    {

        public ImInvGroup_1DAL()
            : base()
        {
            strUpdateFNumberTableName = "t_ICItemCore";
            strGroupTableName = "t_ICItem";
            strFItemClassID = Const.FItemClassID_ItemGroup_1;

        }

        public override int Update(DBAccess dbOrgK3Con, DBAccess dbDestK3Con, string strKeyValue)
        {
            int iDestKey = base.Update(dbOrgK3Con , dbDestK3Con, strKeyValue);

            string strFNumber = dbDestK3Con.GetValue("select fnumber from t_item where fitemid=@fitemid"
                , new SqlParameter[] { new SqlParameter("@fitemid", iDestKey.ToString()) });
            string strSql = @"update t_item set ffullname='' where fnumber like @fnumber and fitemclassid=4";
            dbDestK3Con.ExecuteSql(strSql
                , new SqlParameter[] { new SqlParameter("@fnumber", strFNumber + ".%") });

            return iDestKey;
        }
         
    }
}
